package almacenes.modelo.entidad;
// Generated 16/02/2012 04:45:02 PM by Hibernate Tools 3.4.0.CR1



import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * Stockprodagrup generated by hbm2java
 */
@Entity
@Table(name="STOCKPRODAGRUP"
    , uniqueConstraints = @UniqueConstraint(columnNames={"ID_PRODUCTO", "ID_AGRUPAMIENTO"}) 
)
public class Stockprodagrup  implements java.io.Serializable {

	 private static final long serialVersionUID = 1L;
	 private long idStockprodagrup;
     private Agrupamiento agrupamiento;
     private Producto producto;
     private Integer stock;
     private String usuReg;
     private Date fecReg;
     private String usuAct;
     private Date fecAct;
     private List<Kardex> kardexes = new ArrayList<Kardex>();
     private List<StockprodagrupRep> stockprodagrupReps = new ArrayList<StockprodagrupRep>();
     private List<StockprodagrupDestino> stockprodagrupDestinos = new ArrayList<StockprodagrupDestino>();
     private List<InspeccionDetalle> inspeccionDetalles = new ArrayList<InspeccionDetalle>();

    public Stockprodagrup() {
    }

	
    public Stockprodagrup(long idStockprodagrup, Agrupamiento agrupamiento, Producto producto) {
        this.idStockprodagrup = idStockprodagrup;
        this.agrupamiento = agrupamiento;
        this.producto = producto;
    }
    public Stockprodagrup(long idStockprodagrup, Agrupamiento agrupamiento, Producto producto, Integer stock, String usuReg, Date fecReg, String usuAct, Date fecAct,  List<Kardex> kardexes,  List<StockprodagrupRep> stockprodagrupReps,  List<StockprodagrupDestino> stockprodagrupDestinos,  List<InspeccionDetalle> inspeccionDetalles) {
       this.idStockprodagrup = idStockprodagrup;
       this.agrupamiento = agrupamiento;
       this.producto = producto;
       this.stock = stock;
       this.usuReg = usuReg;
       this.fecReg = fecReg;
       this.usuAct = usuAct;
       this.fecAct = fecAct;
       this.kardexes = kardexes;
       this.stockprodagrupReps = stockprodagrupReps;
       this.stockprodagrupDestinos = stockprodagrupDestinos;
       this.inspeccionDetalles = inspeccionDetalles;
    }
   
     @Id 

    
    @Column(name="ID_STOCKPRODAGRUP", unique=true, nullable=false, precision=10, scale=0)
    public long getIdStockprodagrup() {
        return this.idStockprodagrup;
    }
    
    public void setIdStockprodagrup(long idStockprodagrup) {
        this.idStockprodagrup = idStockprodagrup;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ID_AGRUPAMIENTO", nullable=false)
    public Agrupamiento getAgrupamiento() {
        return this.agrupamiento;
    }
    
    public void setAgrupamiento(Agrupamiento agrupamiento) {
        this.agrupamiento = agrupamiento;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ID_PRODUCTO", nullable=false)
    public Producto getProducto() {
        return this.producto;
    }
    
    public void setProducto(Producto producto) {
        this.producto = producto;
    }

    
    @Column(name="STOCK", precision=7, scale=0)
    public Integer getStock() {
        return this.stock;
    }
    
    public void setStock(Integer stock) {
        this.stock = stock;
    }

    
    @Column(name="USU_REG", length=10)
    public String getUsuReg() {
        return this.usuReg;
    }
    
    public void setUsuReg(String usuReg) {
        this.usuReg = usuReg;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="FEC_REG", length=7)
    public Date getFecReg() {
        return this.fecReg;
    }
    
    public void setFecReg(Date fecReg) {
        this.fecReg = fecReg;
    }

    
    @Column(name="USU_ACT", length=10)
    public String getUsuAct() {
        return this.usuAct;
    }
    
    public void setUsuAct(String usuAct) {
        this.usuAct = usuAct;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="FEC_ACT", length=7)
    public Date getFecAct() {
        return this.fecAct;
    }
    
    public void setFecAct(Date fecAct) {
        this.fecAct = fecAct;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="stockprodagrup")
    public List<Kardex> getKardexes() {
        return this.kardexes;
    }
    
    public void setKardexes(List<Kardex>  kardexes) {
        this.kardexes = kardexes;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="stockprodagrup")
    public List<StockprodagrupRep> getStockprodagrupReps() {
        return this.stockprodagrupReps;
    }
    
    public void setStockprodagrupReps(List<StockprodagrupRep> stockprodagrupReps) {
        this.stockprodagrupReps = stockprodagrupReps;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="stockprodagrup")
    public List<StockprodagrupDestino> getStockprodagrupDestinos() {
        return this.stockprodagrupDestinos;
    }
    
    public void setStockprodagrupDestinos(List<StockprodagrupDestino> stockprodagrupDestinos) {
        this.stockprodagrupDestinos = stockprodagrupDestinos;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="stockprodagrup")
    public List<InspeccionDetalle> getInspeccionDetalles() {
        return this.inspeccionDetalles;
    }
    
    public void setInspeccionDetalles(List<InspeccionDetalle> inspeccionDetalles) {
        this.inspeccionDetalles = inspeccionDetalles;
    }




}


